<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>js变量</title>
</head>
<body>
    <script>
        var i=5;
        var j=16;
        var m=i+j;
        document.write(m);
    </script>
    <script>
        var string="hello";//字符串
        var i=1;//定义数字
        var flag=true;//布尔类型
        var arr=[5,6,7,8,9,10]; //可以是数字
        document.write(arr[4]);//输出是9 数组从0 1 2 3 4 5 6.....开始往外输出
        document.write(arr[0]); 输出5
    </script>
    <br>
    <script>
        var arr=["hello","jikexueyuan","nihao","world"]//可以是字符串
        document.write(arr[3])
    </script>
    <br>
    <script>
        var arr=new Array("hello","jikexueyuan");
        document.write(arr[1]);
    </script>
    <br>
    <script>
        var arr=new Array();
        arr[0]=0;
        arr[1]=10;
        arr[2]=20;
        arr[3]=30;
        document.write(arr[1]);
        var n=null;
        document.write(n);
    </script>
</body>
</html>